<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var str = 'abcdefg';
console.log(str.slice(1, 4));   	//返回bcd
console.log(str.slice(-3, -1)); 	//返回ef
console.log(str.slice(1, -1));  	//返回bcdef
console.log(str.slice(-1, -3)); 	//返回空字符串

  </script>
 </body>
</html>
